Japanese Unexamined Patent Publication JP-A 57-191653 (1982) discloses an image forming apparatus as one example of an apparatus that produces clear copies at unity magnification of a document, such as a bound book or notebook, whose center binding portion, when placed on a document platen, is separated from the document platen. This image forming apparatus corrects image distortion and brightness by measuring the distance between the document and the document platen and by adjusting the scan speed, the height of the document platen, and the luminance of the light source in accordance with the measured distance; when a straight line along the center binding is taken as the y axis and the direction of a double page spread as the x axis, the image forming apparatus provides an effective method, provided that the document platen and the document do not form any slope angles along the y-axis direction, but form a constant slope angle θ only along the x-axis direction.
A technique for accomplishing image correction on the basis of the input image alone is disclosed in Japanese Unexamined Patent Publication JP-A 5-161004 (1993) in relation to a document reading apparatus. In this document reading apparatus, a document is read by a document reading means to obtain image information, and the boundary between the document and the document platen is detected by a boundary detection means. Based on the result of the boundary detection, the shape and the curvature of the document are detected, and the captured image data is corrected on the basis of the result of the detection. Further, in this document reading apparatus, the color of the document platen is chosen to be non-white color such as black for easy distinction between a document and the document platen, and the apparatus is applicable where the difference of height between both edges of the document is smaller than a certain value.
Further, according to an image processing apparatus disclosed in Japanese Unexamined Patent Publication JP-A 8-181828 (1996), the constraints imposed on the color of the document platen or the document color, which has been the problem with image reading apparatuses such as one disclosed in JP-A 5-161004, are alleviated by providing a document guide with a black and white stripe pattern on the surface that contacts the document.
On the other hand, Japanese Unexamined Patent Publication JP-A 10-65877 (1998) discloses, in relation to an image processing apparatus described therein, a technique for detecting an edge in an image captured from a document, and for correcting the document for height and rotational distortions by detecting document skew from the obtained edge.
However, the image forming apparatus disclosed in JP-A 57-191653 has had the problem that it requires the provision of a very complex mechanism, since the scan speed, the height of the document platen, and the luminance of the light source have to be limited while reading an image.
Furthermore, since results obtained by distance measuring means generally contain errors, there has been the problem that the result of the measurement does not agree with the actual distance between the document and the document platen and, as a result, the captured image cannot always be corrected so that it appears flat.
In the document reading apparatus disclosed in JP-A 5-161004, there is no need to detect the height of the document surface using distance measuring means such as a sensor as in the above-described image forming apparatus, and corrections for distortion and brightness are made on the basis of the image alone, but since the position of the boundary is uniquely associated with the document height, the document reading apparatus disclosed therein has had the problem that corrections cannot be made if the document is not placed in the specified position or if the document is placed by being rotated relative to that position.
A further problem has been that corrections cannot be made unless the document height is kept within a predetermined range along the main scanning direction of the reading means; only a warning is issued if the document height is not kept within the predetermined range along the main scanning direction of the reading means.
Further, with the prior art edge position detection method, as disclosed in JP-A 10-65877, if a connected component of an edge-detection filtered image is less than a predetermined value, it is judged to be an isolated point, and if the connected component is less than the predetermined value, interpolation is performed using a straight line; this method, however, has had the problem that edge detection errors and omissions of edge detection are liable to occur.
For the detection of the binding position, a method that judges a maximum or minimum point of the edge position to be the binding position has been used in the prior art, as disclosed in JP-A 10-65877. Therefore, this method has had the problem that if the document contains a localized irregularity such as a crease, such irregularity may be erroneously detected as the binding position.
As for the reference line slope, since the lower line of the document guide is used as the reference line as described, for example, in JP-A 8-181828, the prior art has had the problem that if the document guide is not provided, the reference line or the slope of the reference line cannot be obtained.
Furthermore, since end points of a document are detected using a criterion common to two facing pages, as described in JP-A 8-181828, there has been the problem that the end points of the left and right pages cannot be detected correctly in the case of an apparatus such as a scanner or a copying machine in which light is usually projected in an oblique direction.
Further, in any of the techniques disclosed in JP-A 57-191653, JP-A 5-161004, and JP-A 8-181828, since the document height is assumed to be constant along the main scanning direction of the reading means, there has been the problem that image correction cannot be accomplished if the amount of lift differs between the top and bottom of the document. A further problem has been that, if the amount of lift at top and bottom differs between the left and right pages, proper correction cannot be accomplished by maintaining an optimum balance between the left and right pages.
Further, in the prior art, image portions near the binding tend to darken, rendering the correction incomplete or impossible. Moreover, there has been the problem that when correcting for the binding portion, the correction is particularly difficult if the document color is not white.
The prior art has had the further problem that since the shape is identified directly from the captured high-resolution image, the processing speed is slow and a large amount of memory is used.
Furthermore, since image reading is performed using the same characteristics regardless of the need for image distortion correction, there has been the problem that if there is no need for distortion correction, the black/white contrast becomes too low, and if distortion correction is performed, edge detection becomes difficult.
The prior art has also had the problem that no automatic correction stop function is incorporated, resulting in wasteful paper output.
To solve the above-enumerated problems, it is an object of the present invention to provide an image correction apparatus that corrects an image for geometric distortion and brightness as if the original document were flat, even when the document is rotated or when the amount of lift at the binding differs between the top and bottom of the document.